package com.itita.ww2.game.alliance.enums;

public enum AlJoinLimitType {
	OPEN(0), // 允许任何人
	INVITE_ONLY, // 需要验证
	CLOSED, // 拒绝任何人加入

	;
	private int value;

	private AlJoinLimitType() {
		this(Counter.nextValue);
	}

	private AlJoinLimitType(int value) {
		this.value = value++;
		Counter.nextValue = value;
	}

	public static AlJoinLimitType valueOf(int value) {
		for (AlJoinLimitType type : values()) {
			if (type.getValue() == value) {
				return type;
			}
		}
		return OPEN;
	}

	public int getValue() {
		return value;
	}

	private static class Counter {
		private static int nextValue = 0;
	}
}
